package com.dces.jx.billtest.common.service;
import com.dces.jx.billtest.common.dao.TrackLogMapper;
import com.dces.jx.billtest.common.model.TrackLog;
import com.google.common.base.Strings;
import com.xdo.common.base.service.BaseService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.common.Mapper;
import javax.annotation.Resource;
/**
 * 跟踪服务
 *
 * @author: warrior
 * @date: 2018/11/8
 */
@Service
public class TrackLogService extends BaseService<TrackLog> {
    @Resource
    private TrackLogMapper trackLogMapper;
    @Override
    public Mapper<TrackLog> getMapper() {
        return trackLogMapper;
    }
    /***
     * 保存跟踪日志
     * @param log
     */
    public void saveLog(TrackLog log) {
        if (Strings.isNullOrEmpty(log.getInsertUser())) {
            log.setInsertUser("system");
        }
        trackLogMapper.insert(log);
    }
}
